export const formValidation = {
  username: {
    required: "errors:user-required",
    minLength: {
      value: 8,
      message: "errors:user-min-length",
    },
    pattern: {
      value: /^[a-z_]{4,20}$/i,
      message: "errors:username-pattern",
    },

    maxLength: {
      value: 20,
      message: "errors:user-max-length",
    },
  },
  identifier: {
    required: "errors:user-required",
    minLength: {
      value: 8,
      message: "errors:user-min-length",
    },

    maxLength: {
      value: 20,
      message: "errors:user-max-length",
    },
  },
  email: {
    required: "errors:email-required",
    pattern: {
      value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
      message: "errors:email-pattern",
    },
  },
  password: {
    required: {
      value: true,
      message: "errors:pass-required",
    },
    minLength: {
      value: 8,
      message: "errors:pass-min-length",
    },
    pattern: {
      value: /^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$/i,
      message: "errors:pass-pattern",
    },
  },
  phoneNumber: {
    required: "errors:phone-required",
    pattern: {
      value: /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s/0-9]*$/i,
      message: "errors:phone-pattern",
    },
    maxLength: {
      value: 12,
      message: "errors:phone-max-length",
    },
  },
  countryCode: {
    required: "Required!",
    maxLength: {
      value: 3,
      message: "errors:country-max-length",
    },
    pattern: {
      value: /^(\+?\d{1,3}|\d{1,4})$/,
      message: "errors:country-pattern",
    },
  },
};
